package settings

type DayKline struct {
	Date       string `json:"date" bson:"date"`
	TimeStamp  int64  `json:"time_stamp" bson:"time_stamp"`
	StartPrice string `json:"start_price" bson:"start_price"`
	EndPrice   string `json:"end_price" bson:"end_price"`
	HighPrice  string `json:"high_price" bson:"high_price"`
	LowPrice   string `json:"low_price" bson:"low_price"`
	AllHands   string `json:"all_hands" bson:"all_hands"`
	AllMoney   string `json:"all_money" bson:"all_money"`
	Other1     string `json:"other1" bson:"other1"`
	Other2     string `json:"other2" bson:"other2"`
	Other3     string `json:"other3" bson:"other3"`
	Other4     string `json:"other4" bson:"other4"`
	Other5     string `json:"other5" bson:"other5"`
	Other6     string `json:"other6" bson:"other6"`
	Other7     string `json:"other7" bson:"other7"`
}

type DayKlinePg struct {
	ID         uint   `gorm:"primaryKey"`
	Symbol     string `gorm:"index"`
	Date       string // 可以使用 time.Time 类型
	TimeStamp  int64
	StartPrice float64 `gorm:"column:start_price"`
	EndPrice   float64 `gorm:"column:end_price"`
	HighPrice  float64 `gorm:"column:high_price"`
	LowPrice   float64 `gorm:"column:low_price"`
	Top        int     `gorm:"column:top"`
	AllHands   int64   `gorm:"column:all_hands"`
	AllMoney   float64 `gorm:"column:all_money"`
	Other1     float64 `gorm:"column:other1"`
	Other2     float64 `gorm:"column:other2"`
	Other3     float64 `gorm:"column:other3"`
	Other4     float64 `gorm:"column:other4"`
	Other5     float64 `gorm:"column:other5"`
	Other6     float64 `gorm:"column:other6"`
	Other7     float64 `gorm:"column:other7"`
}

func (DayKlinePg) TableName() string {
	return "daily_stock_prices"
}

type SnowOneKlinePg struct {
	ID         uint   `gorm:"primaryKey"`
	Symbol     string `gorm:"index"`
	Date       string // 可以使用 time.Time 类型
	TimeStamp  int64
	StartPrice float64 `gorm:"column:start_price"`
	EndPrice   float64 `gorm:"column:end_price"`
	HighPrice  float64 `gorm:"column:high_price"`
	LowPrice   float64 `gorm:"column:low_price"`
	Top        int     `gorm:"column:top"`
	AllHands   int64   `gorm:"column:all_hands"`
	AllMoney   float64 `gorm:"column:all_money"`
	Other1     float64 `gorm:"column:other1"`
	Other2     float64 `gorm:"column:other2"`
	Other3     float64 `gorm:"column:other3"`
	Other4     float64 `gorm:"column:other4"`
	Other5     float64 `gorm:"column:other5"`
	Other6     float64 `gorm:"column:other6"`
	Other7     float64 `gorm:"column:other7"`
}

func (SnowOneKlinePg) TableName() string {
	return "one_snow_stock_prices"
}

type DayStock struct {
	Symbol    string     `json:"symbol" bson:"symbol"`
	DayKlines []DayKline `json:"dayKlines" bson:"dayKlines"`
}

type Stock struct {
	Name   string `json:"name" bson:"name"`
	Code   string `json:"code" bson:"code"`
	Price  int64  `json:"price" bson:"price"`
	Prefix string `json:"prefix" bson:"prefix"`
	Exist  int    `json:"exist" bson:"exist"`
	Symbol string `json:"symbol" bson:"symbol"`
}

type StockPg struct {
	ID     uint   `gorm:"primaryKey"`
	Name   string `json:"name" gorm:"column:name"`
	Code   string `json:"code" gorm:"column:code"`
	Price  int64  `json:"price" gorm:"column:price"`
	Prefix string `json:"prefix" gorm:"column:prefix"`
	Exist  int    `json:"exist" gorm:"column:exist"`
	Symbol string `json:"symbol" gorm:"column:symbol"`
	Type   int    `json:"type" gorm:"column:type"`
}

func (StockPg) TableName() string {
	return "stock_info"
}

// 定义结构体来映射 JSON 数据
type OneResponse struct {
	Rc     int     `json:"rc"`
	Rt     int     `json:"rt"`
	Svr    int     `json:"svr"`
	Lt     int     `json:"lt"`
	Full   int     `json:"full"`
	DLMKts string  `json:"dlmkts"`
	Data   OneData `json:"data"`
}

// 定义根结构体
type SnowResponse struct {
	Data SnowStockData `json:"data"`
}

// 定义股票数据结构体
type SnowStockData struct {
	Symbol string      `json:"symbol"`
	Item   [][]float64 `json:"item"`
}

type DayData struct {
	Code       string   `json:"code"`
	Market     int      `json:"market"`
	Name       string   `json:"name"`
	Decimal    int      `json:"decimal"`
	DkTotal    int      `json:"dktotal"`
	PreKPrice  float64  `json:"preKPrice"`
	PrePrice   float64  `json:"prePrice"`
	QtMiscType int      `json:"qtMiscType"`
	Klines     []string `json:"klines"`
}

type OneData struct {
	Code        string   `json:"code"`
	Market      int      `json:"market"`
	Name        string   `json:"name"`
	Decimal     int      `json:"decimal"`
	TrendsTotal int      `json:"trendsTotal"`
	Trends      []string `json:"trends"`
}

var StockDayLineUrl = "http://push2his.eastmoney.com/api/qt/stock/kline/get?secid=%s&klt=1&fqt=1&lmt=%s&end=20500000&iscca=1&fields1=f1,f2,f3,f4,f5,f6,f7,f8&fields2=f51,f52,f53,f54,f55,f56,f57,f58,f59,f60,f61,f62,f63,f64&ut=f057cbcbce2a86e2866ab8877db1d059&forcect=1"
var StockOneLineUrl = "http://push2his.eastmoney.com/api/qt/stock/trends2/get?secid=%s&fields1=f1,f2,f3,f4,f5,f6,f7,f8,f9,f10,f11,f12,f13,f14,f17&fields2=f51,f53,f54,f55,f56,f57,f58&iscr=0&iscca=0&ndays=5&cb=quotepushdata2"
var StockOneLineSnowUrl = "http://stock.xueqiu.com/v5/stock/chart/kline.json?symbol=%s&begin=%d&period=1m&type=before&count=-241&indicator=kline,pe,pb,ps,pcf,market_capital,agt,ggt,balance"

var Headers = [...]string{"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1623.0 Safari/537.36",
	"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; Media Center PC 6.0; InfoPath.3; MS-RTC LM 8; Zune 4.7)",
	"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20120101 Firefox/29.0",
	"Opera/9.80 (X11; Linux x86_64; U; Ubuntu/10.10 (maverick); pl) Presto/2.7.62 Version/11.01",
	"Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; it-it) AppleWebKit/533.20.25 (KHTML, like Gecko) Version/5.0.4 Safari/533.20.27",
	"Mozilla/5.0 (Windows x86; rv:19.0) Gecko/20100101 Firefox/19.0",
	"Mozilla/5.0 (Windows NT 4.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36",
	"Mozilla/5.0 (Microsoft Windows NT 6.2.9200.0); rv:22.0) Gecko/20130405 Firefox/22.0",
	"Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.17 Safari/537.36",
	"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1468.0 Safari/537.36",
	"Mozilla/5.0 (Windows NT 6.2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1464.0 Safari/537.36",
	"Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.16 Safari/537.36",
	"Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.3319.102 Safari/537.36",
	"Mozilla/5.0 (X11; CrOS i686 3912.101.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36",
	"Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36",
	"Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1667.0 Safari/537.36",
	"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:17.0) Gecko/20100101 Firefox/17.0.6",
	"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1468.0 Safari/537.36",
	"Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2224.3 Safari/537.36",
	"Mozilla/5.0 (X11; CrOS i686 3912.101.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36",
}

var Cookies = [...]string{"xq_a_token=220b0abef0fac476d076c9f7a3938b7edac35f48; xqat=220b0abef0fac476d076c9f7a3938b7edac35f48; xq_r_token=a57f65f14670a8897031b7c4f10ea42a50894850; xq_id_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ1aWQiOi0xLCJpc3MiOiJ1YyIsImV4cCI6MTczNTY5Mjg4OSwiY3RtIjoxNzMzNDY5NDk2MTUyLCJjaWQiOiJkOWQwbjRBWnVwIn0.Iz9FHXWupCRBQLQ2QYzd7xvK0jxVM-QFahXyf6D5hvN3COgPvEyNkFaK3auajvfJkUljNusI5ONYKqk2T0dxWJIwo5mpz4ehqeZrlwDPZIBTMzs6sJUXxjnRZAQUDgEXTXr8kcN7fcSK-hUQoSjm4Jo-uvlwhaR6gBQE8d0tmLzPmHO7pCYZfQ3c95eiQAikKj7UiV2NhPBrwpM8-9v9ZrCGBEF4EmKMHoKgzx81Rm0c-IKKU4cD3Il-36y-HMHywIy4_WSEDkrhvDG19t_-Fb9YI9xk3vXNOSTh_tBh26VyeTvoHsicO8KM6v-KyZvjIiiQjntel7z4-Bvk9fu7lw; cookiesu=181733469535934; u=181733469535934; Hm_lvt_1db88642e346389874251b5a1eded6e3=1733469536; Hm_lpvt_1db88642e346389874251b5a1eded6e3=1733469536; HMACCOUNT=ADFBE61418719F17; device_id=082925264e849458d855243112b005b2; ssxmod_itna=YqjhYvqfxAxUxDqxBcDB4ntIG7CGO/7iW/YKevtABDBwTO4iNDnD8x7YDvIjOD0xbPYqWDrh+FKVngxmFdYl+2D56YB03QYQ8PSHpoD84i7DKqibDCqD1D3qDkTDqYY1Dt4DTD34DYDihtDGTiBCqDFSutZlTQy7wQBSqDECT=DYu=DmkTDnrr4=jN2/YrDfb=DITiyQqGnD0QH1MR/D0f=TcaDzT=DbEpM91HDtTncQu4D5jiyl1+Nz3Soe8D0b+wNBBvq7D4T774iGGq4/gCAo5+sCB5tBYCtAzzYDD39vG+NeD===; ssxmod_itna2=YqjhYvqfxAxUxDqxBcDB4ntIG7CGO/7iW/YKevtYD8wpqD55D/7GKDFhgDNIKf5UN0KQkD0N3nrAKN4YE=bYQhif2xyGChIg0hiz+IEiOQhsQ/Pidsg34v8tkOQqKFc5PfAFtleeFm502xqv=u50=yQy2xbAcHkAhA8V2c1Y8oCP39mhZAIKtoaq6YCV20zDEKInESFAPyG4c8+KKdzKf3F+gf6y6afc/x5uCdLPVkUBGe6BRPiD2xOuD1NQGFcCiGnKoQ=TUEm4wZRTa3UAFfwWHt5+Du+VEipn2DFtBErgBxN8kcfg7DMSDYw5w+7L4oaxOY8HPoFYxzS453GKy8dFlqZOTNnKxhdBEia4hsBd3gqVkDsxoNerD2KPTofOTVwqlYtaSh4QrM+tLfiBoQ0qNLxP42+7xYuqO0xTmkau+1twoQ8hZbwjMpFO+76fqMCkh7Z2hbPd303z1NwaOjlCM8LpqIaTGeMxBYQnYKVODkfPD7QN7GPxmqYhzDhAgDxuxjWBVnAAxx+cAMf6M4mwmmPc7dHBqX53TGb4YzWGejOCYS9QG/h7DjKDeu3wiu3FDD==", ""}
